home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
0769B.ZIP
/
DB3UTIL.DOC
< prev
next >
Wrap
Text File
|
1987-05-26
|
19KB
|
449 lines
d B 3 U T I L v 1.61
dBASE III FILE ANALYZER AND QUICKSILVER COMPILER UTILITY
All Rights Reserved 1986,1987
John Calvin Thames
PES, Inc.
11440 Isaac Newton Square
Suite 209
Reston, Virginia 22090
703/471-8383
COPYING, DISTRIBUTION, AND CAVEATS:
dB3UTIL may be copied and distributed freely. However, if you
distribute dB3UTIL on BBSes, CompuServe, the Source, GEnie, et al,
please include the following files as a set:
dB3UTIL.EXE
dB3UTIL.DOC
dB3UTIL.NEW
DBU_QS.BAT
No fee other than a disk and handling charge (of up to $10) should
be charged.
I do not request nor do I expect to receive any payment from the
distribution and use of dB3UTIL. Likewise I will not be responsible
for any damages caused by use, misuse, or inability to use dB3UTIL.
DESCRIPTION:
dB3UTIL is a utility program for dBase III programmers especially
those using WordTech's Quicksilver compiler. The program provides seven
basic functions:
1. Lists all nonduplicate program, format, procedure, database,
index, memory, and report form files called in a dBase system
tree beginning with the specified file and all subsequent
files called. Also can report on a single file only. Reports
any files which were called and could not be found. Lists to
either the screen or a printer.
2. Provides a detailed analysis for each program in the system tree
(or one program only) of each program, format, procedure,
database, index, memory, and report form file called by that
program. Also lists each database used and each index file used
by that database, the key expressions for each index, and the
structure for each database. Reports on called files which could
not be found.
3. QSMAKE - Creates a list file for use with the Quicksilver compiler.
Includes files which have been changed since the last compile
date or a user specified date (a la UNIX MAKE). Saves time by
eliminating the recompilation of files which have not changed.
- 1 -
4. Allows a global find and replace of strings with or without a
query in one file or all files in a system tree. For example
this allows a mass change of a variable name throughout the
entire system of programs called by a root program.
5. Performs an automatic backup of modified files in a dBase
system to a specified drive and/or path.
6. Executes the Quicksilver compiler, linker, and optimizer from
dB3UTIL.
7. Encrypts and decrypts specified databases. Encrypted databases
cannot be used by dBase.
Typing dB3UTIL ? displays the help screen shown below.
================================================================================
dB3UTIL v 1.61 Usage : dB3UTIL <filename> [db3util switch] [date]
<filename> : root, main program, or parent dBASE file with extension
[db3util switch] : -A, -C, -L, -R, and -RQ of the following cannot be used
together on a command line
[blank] = List files to screen
-A = Print analysis of files
-B<path> = Backup files to specified path
-C = Create QUICKSILVER Compiler listfile
-D<drive> = Object-code files located on specified drive
-E<filename> = Encrypt/decrypt database <filename>
-F = 1st character of filename dropped to form object-code file
-L = List files to printer
-O = Analyze <filename> only
-Q = Execute QUICKSILVER Compiler with listfile
-R[<str1>:<str2>] = Find and replace (without query) <str1> with <str2>
-RQ[<str1>:<str2>] = Find and replace (with query) <str1> with <str2>
[date] : specifies file creation or change date (mm/dd/yyyy) for
-C option. [blank] defaults to last compile date.
================================================================================
<filename> = Identifies the program file on which the analysis begins.
Usually this file will be the first file used when running a
program. Unless the -O option is selected, all subordinate
files called by this program file will be analyzed. The
file extension (e.g. .PRG) must be included when specifying
the file name. A path can also be specified. For example,
dB3UTIL B:\ACCOUNT\INVOICE.PRG will change the active
directory to B:\ACCOUNT. At the conclusion of the program,
control will be returned to the original directory.
- 2 -
<db3util switch> = This option switch selects the type of analysis to be
conducted. The options -A, -C, -L, -R, and -RQ cannot
be used together on the same command line. If more than
one is specified, the first option listed will be the
command which is executed.
[blank] = If there are no options selected, the program
default is to list to the screen all of the
files by file type (program, format, database,
etc.) found during the analysis.
-A = Prints to a printer an analysis of which files
are used by each of the other files. A list
is also printed of each database and the index
file(s) used by that database, the key expression
of each index, and the structure of each database.
Also listed are any files which are called and
cannot found in the active directory.
-B<path> = Performs an automatic backup of modified files
in a dBase system identified by root file
<filename> to a specified <path>. The path may
be a disk drive and/or subdirectory. The file is
copied to the target path if it does not exist
there or if it has been changed based on the file
creation time and date. The available disk space
is obtained prior to each file copy. If
insufficient space is available, the user is
prompted to insert a new disk or stop the backup
process. This option creates a disk file of all
of the filenames which comprise the system whether
the files have been modified or not. The name
of this file is formed from the root file
<filename> (less its extension) plus the extension
.@BU. For example, the backup filename for a root
file named TEST.PRG will be TEST.@BU. If this
filename is found in the root file directory, the
user is asked if this file should be used as it
currently exists. If the answer is 'no', the file
is erased and a new file is created.
-C = Creates a Quicksilver Compiler listfile. This
is an ASCII file which contains the names of the
individual program or format files which are to
be compiled. This option is used in conjunction
with the [date] specification. If [date] is
listed, all program files found during the
dB3UTIL analysis which have file creation dates
(as shown when listing a directory) on or after
that [date] will be included in the listfile. If
no [date] is specified and a corresponding
object-code file exists (either in the active
directory or as indicated by the -D option), the
date for each object-code file determines whether
a file is included in the listfile. If no [date]
is specified and no corresponding object-code file
- 3 -
is found, that file is included in the listfile.
This option allows a recompilation only of files
which have been changed since the last compilation.
The listfile will be named <filename>.DBU where
<filename> is the root file (less its extension)
specified on the command line when dB3UTIL is
invoked.
-D<drive> = Identifies the <drive> location of existing object-
code files. This option is used in conjunction
with the -C option.
-E<filename> = Encrypts and decrypts the database with the name
<filename> where <filename> must include the
extension (e.g., .DBF) and may contain a full
path name and the wildcard characters (? or *).
Once encrypted the database cannot be used by
dBase until it has been decrypted. The -E option
determines whether the named database is already
encrypted or not and performs the reversing
procedure. No encryption keys need to specified
by the user. This is the only dB3UTIL option
switch which may be used alone on the command line.
For example, the command
dB3UTIL -e\test\*.dbf
will encrypt or decrypt, as appropriate, all
database files in the directory TEST with the
extension of .DBF. If there are both encrypted
and unencrypted databases which match the
<filename>, the encrypted files will be decrypted
and the unencrypted files will be encrypted.
-F = Indicates if the first letter of the file name was
dropped to form the object-code file. By default
Quicksilver creates an object-code file by adding
the "@" character to the beginning of the compiled
filename. If the filename is eight characters
long, the last character is dropped to form the
object-code name. An option with Quicksilver is
to drop the first rather than the last letter
when forming the object-code filename. The
dB3UTIL -C option needs to know how the name was
formed when it looks for the file creation date.
-L = Performs the same function as using no options
(see [blank] above) except the list of files are
sent to a printer rather than the screen.
-O = Analyses only the single <filename>. This option
does not analyze the files called by <filename>.
-Q = Executes the Quicksilver compiler, linker, and
optimizer from inside dB3UTIL. Actually the
batch file DBU_QS.BAT is executed which in turn
executes Quicksilver. The example batch file
included with dB3UTIL is shown below.
- 4 -
echo off
cls
rem invoke compiler using listfile passed as %1
db3c ~%1
rem invoke linker (for optimizer only) creating
rem .DBC filename passed as %2
db3l -q %2
rem invoke optimizer with DOS linker using .DBC
rem filename created with %2
qs -l %2
This file may be customized by the user to include
any of the Quicksilver options as needed. It is
important to maintain the name of the batch file
as DBU_QS.BAT and to locate the file in the
directory specified with the root file <filename>.
It is equally important to understand the use of
the replaceable parameters %1 and %2. %1 is the
name of the listfile and is passed to DBU_QS.BAT
from dB3UTIL. It must be preceded by the tilde
(~) for Quicksilver to recognize it as a listfile.
%2, also passed to DBU_QS.BAT from dB3UTIL, is the
root file (less its extension) and is used by the
Quicksilver linker to form the name of the .DBC
file and by the optimizer to form the name of the
optimized .EXE file.
For example
dB3UTIL test.prg -c -q
will create a listfile named TEST.DBU and then
execute DBU_QS.BAT with the replaceable parameters
%1 = TEST.DBU and %2 = TEST. It should be noted
that since the listfile contains only those files
which were changed since the last compile, the
batch file DBU_QS.BAT should be modified to include
the necessary references to the location of the
remaining object-code files.
-R[<str1>:<str2>] = Finds and replaces (without query) <str1> with
<str2>. This allows a global replacement of a
string with any other string. If used without
the -O option, <str1> will be replaced in the
specified file and all called files without
waiting for confirmation. The square brackets
must be used as delimiters so that leading and
trailing spaces can be included. For example,
[FOR:THE] is not the same as [ FOR : THE ]. The
first combination would find every usage of FOR
(in the word FORMAT for instance) whereas the
second combination would find only the unique word
FOR. The replacement string <str2> does not have
to be the same length as <str1>. The string
"INTERNATIONAL BUSINESS MACHINES" could replace the
string "IBM". However line lengths in excess of
255 characters could be created which may cause
problems with some text editors.
- 5 -
-RQ[<str1>:<str2>] = Performs the same as the -R option except that
a confirming query is presented prior to any
string replacement. For example the command
-RQ[FOR:THE] will require following question
REPLACE FOR WITH THE? (Y/N)
to be answered with a "Y" before a replacement
takes place. The program line containing the
found <str1> will be displayed above the query.
The -R and -RQ options can be used on any ASCII
file which ends each line with a carriage return
and a line feed.
[date] = Specifies the last file change or creation date
for use with the -C option. See -C above.
- 6 -
NOTES:
1. The <Esc> key will abort dB3UTIL during all operations (except during
the execution of the Quicksilver compiler) and will close all open disk
files normally.
KNOWN PROBLEMS:
1. Currently the program will report file names referenced inside of
TEXT...ENDTEXT blocks. For example,
TEXT
use the cursor keys to move...
ENDTEXT
will cause dB3UTIL to report a database file named THE.
2. Macro substituted file names are ignored.
ACKNOWLEDGEMENTS:
Thomas Hanlin III for the excellent Advanced Function Library for
the BASIC Compiler - ADVBAS.LIB.
Tim Conners (INFOLINK Sysop) for his helpful suggestions.
- 7 -